﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using EPubLibrary.Content.Guide;
using EPubLibrary.PathUtils;
using XHTMLClassLibrary.BaseElements;
using XHTMLClassLibrary.BaseElements.BlockElements;
using XHTMLClassLibrary.BaseElements.InlineElements;

namespace EPubLibrary.XHTML_Items
{
    class LicenseFile : BaseXHTMLFile
    {
        internal LicenseFile()
        {
            FileEPubInternalPath = new EPubInternalPath(EPubInternalPath.DefaultOebpsFolder + "/license/");
            Id = "license";
            FileName = "license.xhtml";
            DocumentType = GuideTypeEnum.Ignore;
        }

        public override void GenerateBody()
        {
            base.GenerateBody();
            pageTitle = "License";
            Div page = new Div();
            H1 heading = new H1();
            heading.Add(new SimpleEPubText { Text = "Converter use license" });
            page.Add(heading);

            Paragraph p1 = new Paragraph();

            p1.Add(new SimpleEPubText { Text = "This file was generated by Lord KiRon's FB2EPUB converter." });
            p1.Add(new SimpleEPubText { Text = "(This book might contain copyrighted material, author of the converter bears no responsibility for it's usage)" });
            page.Add(p1);

            Anchor anch = new Anchor();
            p1 = new Paragraph();
            anch.Add(new SimpleEPubText { Text = @"http://www.fb2epub.net" });
            anch.HRef.Value = @"http://www.fb2epub.net";
            p1.Add(anch);
            page.Add(p1);


            anch = new Anchor();
            p1 = new Paragraph();
            anch.Add(new SimpleEPubText { Text = @"https://code.google.com/p/fb2epub/" });
            anch.HRef.Value = @"https://code.google.com/p/fb2epub/";
            p1.Add(anch);
            page.Add(p1);

            BodyElement.Add(page);
        }


    }
}
